package com.selangshiwo.sina.result;

import java.util.Map;

public class PreLoginResultPack extends ResultPack{
	public int retcode = -1 ;				//登录前请求返回结果标识, 0表示成功，其他值异常
	public int servertime = 0 ;	//服务器时间,重要参数
	public String pcid = "" ;				//暂时不知道干嘛用的
	public String nonce = "";				//重要参数，会参与密码加密
	
	/**
	 * 
	 * 
	 * @param context
	 * @param type				//html json 为统一处理，正常情况传入html
	 * @throws Exception 
	 */
	public PreLoginResultPack(){
		super();
	}
	
	public void initAfter() throws Exception{

		Map<String , ? > result = this.getJson() ;
		this.setRetcode((Integer)result.get("retcode"));
		if(getRetcode() != 0)
			throw new Exception("登录前处理返回结果异常。[" + this.getContext() + "]");
		
		this.setServertime((Integer)result.get("servertime")) ;
		
		this.setNonce((String)result.get("nonce"));
		
		this.setPcid((String)result.get("pcid"));
	}
	
	public int getRetcode() {
		return retcode;
	}
	private void setRetcode(int retcode) {
		this.retcode = retcode;
	}
	public int getServertime() {
		return servertime;
	}
	private void setServertime(int servertime) {
		this.servertime = servertime;
	}
	public String getPcid() {
		return pcid;
	}
	private void setPcid(String pcid) {
		this.pcid = pcid;
	}
	public String getNonce() {
		return nonce;
	}
	private void setNonce(String nonce) {
		this.nonce = nonce;
	}

}
